viridian: add ExProcessorMasks variants of the flush hypercalls
authorPaul Durrant <pdurrant@amazon.com>
Fri, 4 Dec 2020 12:14:59 +0000 (13:14 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Dec 2020 12:14:59 +0000 (13:14 +0100)
commitb4124682db6ead82e856c1d406b5e7590afc228e
tree03a1214e1ab0a7110e8d17fba402a37d8f7cb2aa
parent3a3f4f00afcdcf2cdae47319168b8dadab41c4f4
viridian: add ExProcessorMasks variants of the flush hypercalls

The Microsoft Hypervisor TLFS specifies variants of the already implemented
HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST hypercalls that take a 'Virtual
Processor Set' as an argument rather than a simple 64-bit mask.

This patch adds a new hvcall_flush_ex() function to implement these
(HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST_EX) hypercalls. This makes use of
new helper functions, hv_vpset_nr_banks() and hv_vpset_to_vpmask(), to
determine the size of the Virtual Processor Set (so it can be copied from
guest memory) and parse it into hypercall_vpmask (respectively).

NOTE: A guest should not yet issue these hypercalls as 'ExProcessorMasks'
      support needs to be advertised via CPUID. This will be done in a
      subsequent patch.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
xen/arch/x86/hvm/viridian/viridian.c